import request from '@/utils/request'
import * as proxy from '@/constants/proxy'

//待办，已办，待阅，已阅流程任务数量
const getTaskSummary = () => {
  return request({
    url: '/process-api/act/task/getTaskSummary',
    method: 'post',
    data: {},
  })
}
const getNewsTypes = () => {
  return request.post(proxy.CHECC_API_CMS + `/dictItem/codelist`, ['XTGL_NEWS_TYPE'])
}
//新闻咨询
const getNewsList = (data: any) => {
  return request({
    url: '/checc-api/news/get',
    method: 'post',
    data,
  })
}
//预警列表
const getWarningList = (param) => {
  return request({
    url: proxy.CHECC_API_CMS + '/sy/earlyWarning/list?current='+ param.current,
    method: 'post',
    data: {
      size: 100,
      current: 1,
    },
  })
}
//预警总数
const getWarningCount = () => {
  return request({
    url: proxy.CHECC_API_CMS + '/sy/earlyWarning/getCount',
    method: 'post',
  })
}
// 审核通过
export function allowProcess(data: any) {
  return request({
    url: '/process-api/act/task/completeTaskByVo',
    method: 'post',
    data,
  })
}

// 审核拒绝
export function refuseProcess(data: any) {
  return request({
    url: '/process-api/act/task/over',
    method: 'post',
    data,
  })
}

export { getTaskSummary, getNewsTypes, getNewsList, getWarningList, getWarningCount }
